package PTA_7;

import java.util.Arrays;
import java.util.Scanner;
class NumberFormatException1 extends RuntimeException {
    public NumberFormatException1(String x) {
        System.out.println("java.lang.NumberFormatException: For input string:\""+x+"\"");
    }
}
public class t4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr =new int[n];
        int i = 0;
        while (i < n) {
            String s = scan.next();
            try {
                if(!s.matches("\\d")) {
                    throw new NumberFormatException1(s);
                } else {
                    arr[i] = Integer.parseInt(s);
                    i++;
                }
            } catch (NumberFormatException1 e) {
                System.out.println(e);
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
